package com.boot.dog.service;

import com.boot.dog.common.util.ApiResult;
import com.boot.dog.entities.pojo.Permission;
import com.boot.dog.entities.pojo.User;

import java.util.List;

/**
 * @Author: MaxLv
 * @Date: 2019/12/2
 */
public interface PermissionService {

    ApiResult<Void> savePermission(Permission permission);

    ApiResult<List<Permission>> searchPermissions(String title);

    ApiResult<Void> delById(Integer id);

    ApiResult<Void> editPermission(Permission permission);

    List<Permission> findByLevelOrderBySortOrder(Integer level);

    List<Permission> findByParentIdOrderBySortOrder(Integer parentId);

    List<Permission> findCurrByLevelOrderBySortOrder(Integer level, User user);

    List<Permission> findCurrByParentIdOrderBySortOrder(Integer parentId, User user);
}
